#include <iostream>
#include <cstring>

// this:c++编译器提供给类的指向本对象的指针
// this->取当前对象的属性和行为
// *this 取当前对象
class Student
{
public:
    Student()
    {
        std::cout<<"无参数构造函数！\n";
        printf("this :%p\n",this);
    }
    Student(int id,const char *name)
    {
        std::cout<<"带参数构造函数"<<std::endl;
        this->id = id;// 用来区分形参和实参
        this->name = name;
    }

    Student& GetObj()
    {
        return *this; // 取当前对象
    }
private:
    int id;
    std::string name;
};

int main()
{
    return 0;
}